package gdkm.wsz.dao;

import gdkm.wsz.pojo.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserDAO {
    @Select("select * from user where id=#{id}")
    User findById(Integer id);
    @Select("select * from user")
    List<User> findAll();
    @Insert("insert into user(username,password,email,phone,user_type,avatar,status,create_time,update_time) values(#{username},#{password},#{email},#{phone},#{user_type},#{avatar},#{status},#{create_time},#{update_time})")
    public int insert(User user);
    @Update("update user set username=#{username},password=#{password},email=#{email},phone=#{phone},user_type=#{user_type},avatar=#{avatar},status=#{status},create_time=#{create_time},update_time=#{update_time} where id=#{id}")
    public int update(User user);
    @Delete("delete from user where id=#{id}")
    public int delete(Integer id);

}
